From: Keir Fraser Date: Thu, 15 Apr 2010 07:42:40 +0000 (+0100) Subject: Remus: fix alignment bug in python rtnl library X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12367 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=82e84243c30fd305a62026db1be8f45cf8ec1bb7;p=xen.git Remus: fix alignment bug in python rtnl library Signed-off-by: Brendan Cully --- diff --git a/tools/python/xen/remus/netlink.py b/tools/python/xen/remus/netlink.py index e184f64ca8..d4895c7f02 100644 --- a/tools/python/xen/remus/netlink.py +++ b/tools/python/xen/remus/netlink.py @@ -77,7 +77,7 @@ class rtattr(object): return align(self.rta_len) def pack(self): - self.rta_len = align(self.fmtlen + len(self.body)) + self.rta_len = self.fmtlen + align(len(self.body), 2) s = struct.pack(self.fmt, self.rta_len, self.rta_type) + self.body pad = self.rta_len - len(s) if pad: @@ -88,7 +88,7 @@ class rtattr(object): args = struct.unpack(self.fmt, msg[:self.fmtlen]) self.rta_len, self.rta_type = args - self.body = msg[align(self.fmtlen):self.rta_len] + self.body = msg[self.fmtlen:self.rta_len] class rtattrlist(object): def __init__(self, msg):